set PROTO_HOME=%~dp0
echo %PROTO_HOME% 

:: clear history file
RD /q /s %PROTO_HOME%output\csharp
RD /q /s %PROTO_HOME%output\java\com

:: add csharp dir
mkdir %PROTO_HOME%output\csharp

:: clear server project file TODO

:: generate target csharp and java file
for /r %PROTO_HOME%proto %%i in (*.proto) do (
    %PROTO_HOME%protoc-3.18.0-win64\bin\protoc.exe --proto_path=%PROTO_HOME% --csharp_out=%PROTO_HOME%output\csharp --java_out=%PROTO_HOME%output\java %PROTO_HOME%proto\%%~ni.proto
)

pause